App({
  onLaunch: function() {
    // 检查登录状态
    this.checkLoginStatus();
  },
  
  globalData: {
    userInfo: null,
    isLogin: false,
    phoneNumber: ''
  },
  
  checkLoginStatus: function() {
    const that = this;
    wx.getStorage({
      key: 'userInfo',
      success: function(res) {
        that.globalData.userInfo = res.data;
        that.globalData.isLogin = true;
      }
    });
    
    wx.getStorage({
      key: 'phoneNumber',
      success: function(res) {
        that.globalData.phoneNumber = res.data;
      }
    });
  }
}) 